﻿using System.Web.Http;
using Newtonsoft.Json;
using MetroDataApi.Models;
using System.Collections.Generic;

namespace MetroDataApi.Controllers
{
    public class SinglePointRecentChangesController : ApiController
    {


        // GET api/singlepointrecentchanges/5
        public string Get(int prjId, string ptName, string queryType = "", string startTime = "", string endTime = "")
        {
            var list = SinglePointRecentChanes.RecentChanges(prjId, ptName, queryType, startTime, endTime);
            return JsonConvert.SerializeObject(list, Formatting.None,
                                        new JsonSerializerSettings()
                                        {
                                            NullValueHandling = NullValueHandling.Ignore,
                                            Converters = new List<JsonConverter> { new StandardFloatConverter() }
                                        });
        }

    }
}
